<!--
 * @Description: 通过ID预览用户
 * @Author: wangwangwang
 * @Date: 2020-09-08 13:34:43
 * @LastEditors: wangwangwang
 * @LastEditTime: 2020-11-14 15:50:26
-->
<template>
  <section>
    <el-dialog v-dialogDrag title="已选人员" :visible.sync="previewVisible" :before-close="hanldeClose">
      <el-table :data="tableData" stripe style="width: 100%" :header-cell-style="{ background: '#ffffff', fontSize:'16px',border: '0' }" :cell-style="{ border: '0', height: '43px' }">
        <el-table-column property="organization" label="组织"></el-table-column>
        <el-table-column property="station" label="岗位"></el-table-column>
        <el-table-column property="userName" label="人员"></el-table-column>
      </el-table>
    </el-dialog>
  </section>
</template>
<script>
import { previewUser } from '@/api/task/flows'
export default {
  props: ['previewVisible', 'personData', 'filterType'],
  watch: {
    personData(data) {
      const items = data.map((item) => {
        return {
          foreignId: item.id,
          foreignType: item.type,
        }
      })
      const params = {
        items,
        previewType: this.filterType
      }
      previewUser(params).then(res => {
        if (res.code === 1001) {
          this.tableData = res.data;
        }
      })
    }
  },
  data() {
    return {
      tableData: [],
    }
  },
  methods: {
    hanldeClose() {
      this.$emit('closePreview')
    }
  },
  mounted() {
  }
}
</script>
<style scoped>
</style>
